<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Invoking Gcov-tool (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Invoking Gcov-tool (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Invoking Gcov-tool (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Gcov_002dtool.html" rel="up" title="Gcov-tool">
<link href="Gcov_002dtool-Intro.html" rel="prev" title="Gcov-tool Intro">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
kbd.key {font-style: normal}
span.r {font-family: initial; font-weight: normal; font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="section-level-extent" id="Invoking-Gcov_002dtool">
<div class="nav-panel">
<p>
Previous: <a href="Gcov_002dtool-Intro.html" accesskey="p" rel="prev">Introduction to <code class="command">gcov-tool</code></a>, Up: <a href="Gcov_002dtool.html" accesskey="u" rel="up"><code class="command">gcov-tool</code>&mdash;an Offline Gcda Profile Processing Tool</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Invoking-gcov_002dtool"><span>11.2 Invoking <code class="command">gcov-tool</code><a class="copiable-link" href="#Invoking-gcov_002dtool"> &para;</a></span></h3>

<div class="example smallexample">
<pre class="example-preformatted">gcov-tool <span class="r">[</span><var class="var">global-options</var><span class="r">]</span> SUB_COMMAND <span class="r">[</span><var class="var">sub_command-options</var><span class="r">]</span> <var class="var">profile_dir</var>
</pre></div>

<p><code class="command">gcov-tool</code> accepts the following options:
</p>

<dl class="table">
<dt><code class="code">-h</code></dt>
<dt><code class="code">--help</code></dt>
<dd><p>Display help about using <code class="command">gcov-tool</code> (on the standard output), and
exit without doing any further processing.
</p>
</dd>
<dt><code class="code">-v</code></dt>
<dt><code class="code">--version</code></dt>
<dd><p>Display the <code class="command">gcov-tool</code> version number (on the standard output),
and exit without doing any further processing.
</p>
</dd>
<dt><code class="code">merge</code></dt>
<dd><p>Merge two profile directories.
</p><dl class="table">
<dt><code class="code">-o <var class="var">directory</var></code></dt>
<dt><code class="code">--output <var class="var">directory</var></code></dt>
<dd><p>Set the output profile directory. Default output directory name is
<var class="var">merged_profile</var>.
</p>
</dd>
<dt><code class="code">-v</code></dt>
<dt><code class="code">--verbose</code></dt>
<dd><p>Set the verbose mode.
</p>
</dd>
<dt><code class="code">-w <var class="var">w1</var>,<var class="var">w2</var></code></dt>
<dt><code class="code">--weight <var class="var">w1</var>,<var class="var">w2</var></code></dt>
<dd><p>Set the merge weights of the <var class="var">directory1</var> and <var class="var">directory2</var>,
respectively. The default weights are 1 for both.
</p></dd>
</dl>

</dd>
<dt><code class="code">merge-stream</code></dt>
<dd><p>Collect profiles with associated filenames from a <em class="emph">gcfn</em> and <em class="emph">gcda</em>
data stream.  Read the stream from the file specified by <var class="var">file</var> or from
<samp class="file">stdin</samp>.  Merge the profiles with associated profiles in the host
filesystem.  Apply the optional weights while merging profiles.
</p>
<p>For the generation of a <em class="emph">gcfn</em> and <em class="emph">gcda</em> data stream on the target
system, please have a look at the <code class="code">__gcov_filename_to_gcfn()</code> and
<code class="code">__gcov_info_to_gcda()</code> functions declared in <code class="code">#include &lt;gcov.h&gt;</code>.
</p><dl class="table">
<dt><code class="code">-v</code></dt>
<dt><code class="code">--verbose</code></dt>
<dd><p>Set the verbose mode.
</p>
</dd>
<dt><code class="code">-w <var class="var">w1</var>,<var class="var">w2</var></code></dt>
<dt><code class="code">--weight <var class="var">w1</var>,<var class="var">w2</var></code></dt>
<dd><p>Set the merge weights of the profiles from the <em class="emph">gcfn</em> and <em class="emph">gcda</em> data
stream and the associated profiles in the host filesystem, respectively.  The
default weights are 1 for both.
</p></dd>
</dl>

</dd>
<dt><code class="code">rewrite</code></dt>
<dd><p>Read the specified profile directory and rewrite to a new directory.
</p><dl class="table">
<dt><code class="code">-n <var class="var">long_long_value</var></code></dt>
<dt><code class="code">--normalize &lt;long_long_value&gt;</code></dt>
<dd><p>Normalize the profile. The specified value is the max counter value
in the new profile.
</p>
</dd>
<dt><code class="code">-o <var class="var">directory</var></code></dt>
<dt><code class="code">--output <var class="var">directory</var></code></dt>
<dd><p>Set the output profile directory. Default output name is <var class="var">rewrite_profile</var>.
</p>
</dd>
<dt><code class="code">-s <var class="var">float_or_simple-frac_value</var></code></dt>
<dt><code class="code">--scale <var class="var">float_or_simple-frac_value</var></code></dt>
<dd><p>Scale the profile counters. The specified value can be in floating point value,
or simple fraction value form, such 1, 2, 2/3, and 5/3.
</p>
</dd>
<dt><code class="code">-v</code></dt>
<dt><code class="code">--verbose</code></dt>
<dd><p>Set the verbose mode.
</p></dd>
</dl>

</dd>
<dt><code class="code">overlap</code></dt>
<dd><p>Compute the overlap score between the two specified profile directories.
The overlap score is computed based on the arc profiles. It is defined as
the sum of min (p1_counter[i] / p1_sum_all, p2_counter[i] / p2_sum_all),
for all arc counter i, where p1_counter[i] and p2_counter[i] are two
matched counters and p1_sum_all and p2_sum_all are the sum of counter
values in profile 1 and profile 2, respectively.
</p>
<dl class="table">
<dt><code class="code">-f</code></dt>
<dt><code class="code">--function</code></dt>
<dd><p>Print function level overlap score.
</p>
</dd>
<dt><code class="code">-F</code></dt>
<dt><code class="code">--fullname</code></dt>
<dd><p>Print full gcda filename.
</p>
</dd>
<dt><code class="code">-h</code></dt>
<dt><code class="code">--hotonly</code></dt>
<dd><p>Only print info for hot objects/functions.
</p>
</dd>
<dt><code class="code">-o</code></dt>
<dt><code class="code">--object</code></dt>
<dd><p>Print object level overlap score.
</p>
</dd>
<dt><code class="code">-t <var class="var">float</var></code></dt>
<dt><code class="code">--hot_threshold &lt;float&gt;</code></dt>
<dd><p>Set the threshold for hot counter value.
</p>
</dd>
<dt><code class="code">-v</code></dt>
<dt><code class="code">--verbose</code></dt>
<dd><p>Set the verbose mode.
</p></dd>
</dl>

</dd>
</dl>



</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="Gcov_002dtool-Intro.html">Introduction to <code class="command">gcov-tool</code></a>, Up: <a href="Gcov_002dtool.html"><code class="command">gcov-tool</code>&mdash;an Offline Gcda Profile Processing Tool</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
